<div>
    <div class="action-bar">
        <button class="btn btn-primary" ng-click="toEdit()">新增</button>
    </div>
    <div class="table-responsive">
        <table class="table ad-table">
            <tr>
                <th>广告标题</th>
                <th>广告分类</th>
                <th>背景色</th>
                <th>广告图片</th>
                <th>广告内容</th>
                <th>广告状态</th>
                <th>操作</th>
            </tr>
            <tr ng-repeat="data in result.list">
                <td>{{data.title}}</td>
                <td>{{data.type == 1 ? '欢迎页广告' : data.type == 2 ? '认证页广告' : data.type == 3 ? '主页广告' : '-'}}</td>
                <td>{{data.color}}</td>
                <td><img ng-src="{{data.url}}" width="100" height="100"></td>
                <td>{{data.content}}</td>
                <td>{{data.state == 0 ? '停用' : '启用'}}</td>
                <td>
                    <a href="javascript:" ng-click="toEdit(data)">修改</a>
                    <a href="javascript:" ng-click="doUpdState(data)">{{data.state == 0 ? '启用' : '停用'}}</a>
                    <a href="javascript:" ng-click="doDelete(data.id)">删除</a>
                </td>
            </tr>
            <tr ng-if="result.list.length == 0">
                <td class="text-center" colspan="5">没有数据</td>
            </tr>
        </table>
        <div class="pagination-bar" ng-if="result.list.length>0">
            <uib-pagination
                    total-items="result.page.totalData"
                    ng-model="result.page.currentNo"
                    max-size="2"
                    items-per-page="result.page.everyPage"
                    first-text="第一页"
                    previous-text="上一页"
                    next-text="下一页"
                    last-text="最后页"
                    boundary-links="true"
                    boundary-link-numbers="true"
                    ng-model="result.page.currentNo"
                    ng-change="onPageChange()"
            ></uib-pagination>
        </div>

    </div>
</div>
